//
//  UILabel+Fit.m
//  TravelGuideMdd
//
//  Created by BigPolarBear on 14-8-4.
//  Copyright (c) 2014年 mafengwo.com. All rights reserved.
//

#import "UILabel+Fit.h"

@implementation UILabel (Fit)

-(void)setSizeWithFixedWidth
{
    CGSize size = [self sizeThatFits:CGSizeMake(self.frame.size.width, CGFLOAT_MAX)];
    CGRect frame = self.frame;
    frame.size = size;
    self.frame = frame;
}

-(void)setSizeWithFixedHeight
{
    CGSize size = [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, self.frame.size.height)];
    CGRect frame = self.frame;
    frame.size = size;
    self.frame = frame;
}
@end
